<?php
//  nilai session
session_start();
// Variabel dari form login
$username = $_POST['username'];
$password = $_POST['password'];

// username = admin & password = admin
if (($username == admin) and ($password == admin)) {
	// daftarkan nilai ke server
	session_register("username");
	session_register("password");
	
	// mengarah pada file index.php
	echo "<meta http-equiv='refresh' content='2; url=index.php'>";
}
// login gagal
else {
	echo "Login Gagal";
	echo "<meta http-equiv='refresh' content='2; url=index.php'>";
}
?>